package com.clip.entity.virtual;

import java.io.Serializable;

import com.clip.util.ToolsUtils;


public class EventForView implements Serializable{
	private Integer id;
	
	private Integer eventid;//eg:memo_1,clock_1,date_1
	
	private Integer uid;
	private Integer fuid;
	private Integer puid;
	private Integer cliptype;
	
	private Integer starthour; //0-23
	private Integer endhour; //1-24
	
	private boolean isAllDay; // starthour=-1 and endhour=-1时
	
	private boolean isClocked; // 
	
	private String eventtype;
	
	private Long starttime;//无则-1 starttime==endtime 则表示为clockevent
	
	private Long endtime;//无则-1
	
	private Integer iswholeday;
	
	private String title;
	
	private String repeatdesc;//无则null
	
	private String address;
	
	private String content;
	
	private Long clocktime;//无则0

	private Long operatetime; //事件操作的时间
	
	private Long savetime;//对象保存的时间
	
	private boolean isThisMonth;
	
	private String holidayName;
	
	private Integer reliedclip;
	
	private Long deadlinetime;
	
	private Integer isvip;
	
	private boolean isTodayOrTommorrow;
	
	private Integer processstatus;
	
	private String publishname="";
	
	private String forwardname="";
	
	private Integer isRead;
	
	private Integer clipstatus;
	
	private Long createtime;
	
	private Long updatetime;
	public Integer getUid() {
		return uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getEventid() {
		return eventid;
	}

	public void setEventid(Integer eventid) {
		this.eventid = eventid;
	}

	public Integer getStarthour() {
		return starthour;
	}

	public void setStarthour(Integer starthour) {
		this.starthour = starthour;
	}

	public Integer getEndhour() {
		return endhour;
	}

	public void setEndhour(Integer endhour) {
		if(endhour!=0)
			this.endhour = endhour;
		else
			this.endhour = 24;
	}

	public boolean isAllDay() {
		return isAllDay;
	}

	public void setAllDay(boolean isAllDay) {
		this.isAllDay = isAllDay;
		if(this.isAllDay){
			this.starthour=-1;
			this.endhour=-1;
		}
	}

	public String getEventtype() {
		return eventtype;
	}

	public void setEventtype(String eventtype) {
		this.eventtype = eventtype;
	}

	public Long getStarttime() {
		return starttime;
	}

	public void setStarttime(Long starttime) {
		this.starttime = starttime;
	}

	public Long getEndtime() {
		return endtime;
	}

	public void setEndtime(Long endtime) {
		this.endtime = endtime;
	}
	
	public Integer getIswholeday() {
		return iswholeday;
	}

	public void setIswholeday(Integer iswholeday) {
		this.iswholeday = iswholeday;
	}

	public String getTitle() {
		return ToolsUtils.xmlCDATA(title);
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getRepeatdesc() {
		return repeatdesc;
	}

	public void setRepeatdesc(String repeatdesc) {
		this.repeatdesc = repeatdesc;
	}

	public String getAddress() {
		if(this.address==null||this.address.length()==0){
			return "";
		}else
			return ToolsUtils.xmlCDATA(address);
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getContent() {
		if(this.content==null||this.content.length()==0){
			return "";
		}else
			return ToolsUtils.xmlCDATA(content);
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Long getClocktime() {
		return clocktime;
	}

	public void setClocktime(Long clocktime) {
		this.clocktime = clocktime;
	}

	public Long getSavetime() {
		return savetime;
	}

	public void setSavetime(Long savetime) {
		this.savetime = savetime;
	}

	public Long getOperatetime() {
		return operatetime;
	}

	public void setOperatetime(Long operatetime) {
		this.operatetime = operatetime;
	}

	public boolean isClocked() {
		return isClocked;
	}

	public void setClocked(boolean isClocked) {
		this.isClocked = isClocked;
	}

	public boolean isThisMonth() {
		return isThisMonth;
	}

	public void setThisMonth(boolean isThisMonth) {
		this.isThisMonth = isThisMonth;
	}

	public String getHolidayName() {
		return holidayName;
	}

	public void setHolidayName(String holidayName) {
		this.holidayName = holidayName;
	}

	public Integer getReliedclip() {
		return reliedclip;
	}

	public void setReliedclip(Integer reliedclip) {
		this.reliedclip = reliedclip;
	}

	public Long getDeadlinetime() {
		return deadlinetime;
	}

	public void setDeadlinetime(Long deadlinetime) {
		this.deadlinetime = deadlinetime;
	}

	public Integer getIsvip() {
		return isvip;
	}

	public void setIsvip(Integer isvip) {
		this.isvip = isvip;
	}

	public boolean isTodayOrTommorrow() {
		return isTodayOrTommorrow;
	}

	public void setTodayOrTommorrow(boolean isTodayOrTommorrow) {
		this.isTodayOrTommorrow = isTodayOrTommorrow;
	}
	public Integer getProcessstatus() {
		return processstatus;
	}

	public void setProcessstatus(Integer processstatus) {
		this.processstatus = processstatus;
	}

	public String getPublishname() {
		return publishname;
	}

	public void setPublishname(String publishname) {
		this.publishname = publishname;
	}

	public Integer getIsRead() {
		return isRead;
	}

	public void setIsRead(Integer isRead) {
		this.isRead = isRead;
	}
	
	public Integer getClipstatus() {
		return clipstatus;
	}

	public void setClipstatus(Integer clipstatus) {
		this.clipstatus = clipstatus;
	}

	public Long getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Long createtime) {
		this.createtime = createtime;
	}

	public Long getUpdatetime() {
		return updatetime;
	}

	public void setUpdatetime(Long updatetime) {
		this.updatetime = updatetime;
	}

	public String getForwardname() {
		return forwardname;
	}

	public void setForwardname(String forwardname) {
		this.forwardname = forwardname;
	}

	public Integer getCliptype() {
		return cliptype;
	}

	public void setCliptype(Integer cliptype) {
		this.cliptype = cliptype;
	}

	public Integer getFuid() {
		return fuid;
	}

	public void setFuid(Integer fuid) {
		this.fuid = fuid;
	}

	public Integer getPuid() {
		return puid;
	}

	public void setPuid(Integer puid) {
		this.puid = puid;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((endtime == null) ? 0 : endtime.hashCode());
		result = prime * result + ((eventid == null) ? 0 : eventid.hashCode());
		result = prime * result
				+ ((starttime == null) ? 0 : starttime.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		EventForView other = (EventForView) obj;
		if (endtime == null) {
			if (other.endtime != null)
				return false;
		} else if (!endtime.equals(other.endtime))
			return false;
		if (eventid == null) {
			if (other.eventid != null)
				return false;
		} else if (!eventid.equals(other.eventid))
			return false;
		if (starttime == null) {
			if (other.starttime != null)
				return false;
		} else if (!starttime.equals(other.starttime))
			return false;
		return true;
	}
	
}
